import axios from 'axios';

// 1. 初始状态.
const state = () => ({
    services: [],
});

// 2. 计算属性.
const getters = {};

// 3. 异步修改.
const actions = {
    loadServices({ state }) {
        axios.get('/service/list').then((data) => {
            state.services = data.data;
        });
    },
};

// 4. 同步修改.
const mutations = {
};

// 5. 模块导出.
export default {
    namespaced: true,
    state,
    getters,
    actions,
    mutations,
};
